package com.helloandroid

import android.content.Intent
import com.business.Analyse
import com.business.AnalyseKey
import com.helloandroid.base.BaseActivity
import com.helloandroid.tools.IntentKey
import com.helloandroid.tools.IntentValue
import com.helloandroid.tools.MyLog

class EmptyActivity : BaseActivity() {
    override fun getContentViewResId(): Int = R.layout.activity_empty

    override fun initView() {
        val where = intent.getIntExtra(IntentKey.ComeFromWhere, -1)
        MyLog.elog("========EmptyActivity where:${where}==================")

        // 打点
        when(where){
            IntentValue.Int_Resdient -> Analyse.report(AnalyseKey.NT_Resdient)
            IntentValue.Int_BuShu -> Analyse.report(AnalyseKey.NT_BuShu)
            IntentValue.Int_Hby -> Analyse.report(AnalyseKey.NT_HongBaoYu)
            IntentValue.Int_ChiFan -> Analyse.report(AnalyseKey.NT_ChiFan)
            IntentValue.Int_Sign -> Analyse.report(AnalyseKey.NT_Sign)
            IntentValue.Int_ZhuanPan -> Analyse.report(AnalyseKey.NT_ZhuanPan)
        }

        if (AppUtil.isLogin) {
            // 直接跳转都mainActivity
            val intent = Intent(this, MainActivity::class.java)
            intent.putExtra(IntentKey.ComeFromWhere, where)
            startActivity(intent)
        } else {
            //  直接跳转到  welcome
            val intent = Intent(this, WelcomeActivity::class.java)
            intent.putExtra(IntentKey.ComeFromWhere, where)
            startActivity(intent)
        }
        finish()
    }

    override fun initData() {
    }
}